package file;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;  
public class FileTest {

    public static void copyFile(String srcPath,String desPath) throws FileNotFoundException, IOException{
    	File srcFile =new File(srcPath);
    	File desFile = new File(desPath);
		 byte[] buffer =new byte[1024];
		 try(
				 FileInputStream fis = new FileInputStream(srcFile);
				 FileOutputStream fos= new FileOutputStream(desFile);
				 ){
			 while(true){
				 int actuallyReaded = fis.read(buffer);
				 if(-1==actuallyReaded)
					 break;
				 fos.write(buffer, 0, actuallyReaded);
				 fos.flush();
				 
			 }
		 }catch (IOException e){
			 e.printStackTrace();
		 }
		 
	}
    public static void main(String[] args) throws FileNotFoundException, IOException {

         Scanner copy=new Scanner(System.in);
         String srcPath=copy.nextLine();
         String desPath=copy.nextLine();
         copyFile(srcPath,desPath);
    }
    
    
}
